%%% Spatial distribution of lake heat release feedback changes

% select models; specific lake model or ensemble mean
for flag_model = 5:5     % 1 = albm,  2 = lake, 3 = simstrat-uog, 4 = vic-lake, 5 = ensemble mean

% The difference between the flag_rcp (pre-industrial or future projections) and present-day period 
for flag_rcp = 2:2;     % #2 = picontrol        #3 = rcp26      #4 = rcp60      #5 = rcp85

% The seasonal or annual results
for flag_period = 5:5   %    #1 = DJF       #2 = MAM       #3 = JJA      #4 = SON      #5 = yearly

% Variable name
var = { 'Heat' };

% Claculate the lake heat release feedback changes
global_dif_Heat = mycode_Heat(flag_rcp, flag_model, flag_period);

% define figure
f1 = figure(1); clf; hold on

% define Cartesian coordinate region
ax = axesm('MapProjection', 'pcarre');
setm( ax, 'MapLatLimit', [-60 90] );
setm( ax, 'MapLonLimit', [-180 180] );

% maps 
h1 = geoshow('landareas.shp','FaceColor', [1 1 1], 'LineWidth', 0.3 );   
h2 = surfm( lat_m, lon_m, mean( global_dif_Heat, 3, 'omitnan' )  );

% sets
setm( ax, 'ffacecolor', [1 1 1] * 0.94 )   
setm( ax, 'grid', 'off', 'glinestyle', '-', 'glinewidth', 0.3000, 'gcolor', [1 1 1] * 0.8 ) 
setm( ax,'MLineLocation', [-135:45:135], 'PLineLocation', [-30:30:60] );   
setm( ax,'meridianLabel','off', 'parallelLabel','off' );  
setm(ax,'MLabelLocation', 45, 'PLabelLocation', 30 );    
setm(ax,'MLabelParallel', 'south'); 
setm( ax, 'Frame', 'on', 'flinewidth', 0.5, 'FEdgeColor', [0 0 0] ) 
axis off  
setm(ax,'FontName','Arial'); 
setm(ax,'FontSize', 7); 
uistack(h2, 'top')

% colorbar
caxis([-10,10]);    
c=colorbar;
c.Ticks=[-8:4:8];       
c.TickDirection = 'out';
c.FontName='Arial';
c.FontSize=7;
c.Location = 'south';
c.AxisLocation = 'out';

% output map size
f_long=11;   
left_long=2;    
bot_long=4;     
c_long=1.3;    
f_a=0.5 ; 
ax.Units='centimeters';     ax.Position=[left_long,  bot_long,  f_long,  f_long*f_a];
c.Units='centimeters';      c.Position=[left_long,  bot_long,  8, 0.3 ];











